import baseApi from '@/api/api'
import * as types from './mutation-types'

const state = {}

const getters = {}

const mutations = {}

const actions = {
	//工件详情
	scanGetUnitDetail({
		commit
	}, param) {
		return baseApi.getUnitDetail(param).then(res => {
			return res.data
		})
	},
	// 退件
	chargebackRepairWorkOrder({
		commit
	}, param) {
		return baseApi.chargebackRepairWorkOrder(param).then(res => {
			return res.data
		})
	},
	// 报废
	scrapWorkOrder({
		commit
	}, param) {
		return baseApi.scrapWorkOrder(param).then(res => {
			return res.data
		})
	},
	// 邮寄
	mailUnit({
		commit
	}, param) {
		return baseApi.mailUnit(param).then(res => {
			return res.data
		})
	},
	// 退单原因
	getRefuseReason({
		commit
	}, param) {
		return baseApi.getDictItemList({
			dictCode: 'refuseReason'
		}).then(res => {
			return res.data
		})
	},
	// 报废原因
	getScrapReason({
		commit
	}, param) {
		return baseApi.getDictItemList({
			dictCode: 'scrapReason'
		}).then(res => {
			return res.data
		})
	},






}

export default {
	state,
	getters,
	mutations,
	actions
}
